import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "Login",
      component: () => import("../views/Login.vue"),
    },

    {
      path: "/Main",
      name: "Main",
      component: () => import("../views/Main.vue"),
      children: [
        {
          path: "/Goods", //商品
          name: "Goods",
          component: () => import("../views/Goods/Goods.vue"),
        },
        {
          path: "/Traceability", //溯源
          name: "Traceability",
          component: () => import("../views/Goods/Traceability.vue"),
        },
        {
          path: "/Dashboard", //首页
          name: "Dashboard",
          component: () => import("../views/Dashboard.vue"),
        },
        {
          path: "/QRcode", //溯源码
          name: "QRcode",
          component: () => import("../views/Goods/QRcode.vue"),
        },
        {
          path: "/Demo", //测试页面
          name: "Demo",
          component: () => import("../views/Goods/Demo.vue"),
        },
      ],
    },
    {
      path: "/about",
      name: "about",
      component: () => import("../views/AboutView.vue"),
    },
  ],
});

export default router;
